<table class="table-grid">
    <thead>
        <tr>
            <th>选择</th>
            <th>客户姓名</th>
            <th>电话号码</th>
            <th>联系地址</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    <foreach name="list" item="vo">
        <tr data-key="{$vo.id}">
            <td title="{$key} {$vo.createdTime}"><input type="checkbox" name="chk" /><input type="hidden" name="zipCode" value="{$vo.zipCode}" /></td>
            <td class="consignee">{$vo.consignee}</td>
            <td class="telphone">{$vo.telphone}</td>
            <td class="address"><div title="{$vo.province} {$vo.city} {$vo.area} {$vo.street}" style="width:150px;" class='notbreakline-ellipsis'>{$vo.province} {$vo.city} {$vo.area} {$vo.street}</div></td>
            <td class="no-padding">
                <a href="{:U('Address/address_edit','id='.$vo['id'].'&uid='.$vo['userID'])}" class="btn-edit">编辑</a>
                <a href="{:U('Address/address_delete','id='.$vo['id'].'&uid='.$vo['userID'])}" class="btn-minus">删除</a>
            </td>
        </td></tr>
    </foreach>
</tbody>
</table>
{$pager}
<script type="text/javascript">
    $('input[name="chk"]').click(function () {
        if ('undefined' == typeof (window.parent.set_address)) {
            alert('未设置选择地址的方法!');
        } else {
            var $tr = $(this).parent().parent();
            window.parent.set_address($tr.find('.consignee').text(), $tr.find('.telphone').text(), $tr.find('.address').text(), $tr.find('input[name="zipCode"]').val());
        }
    })
</script>